﻿namespace Data.Repository
{
	using System.Linq;
	using System.Collections.Generic;

	public interface IAddressRepository
	{
		int CreateNewAddress(Data.Entity.Address theNewAddress);
		int DeleteAddress(int id);
        int UpdateAddress(Entity.Address theAddress);
		IList<Data.Entity.Address> GetTheUserAddresses(System.Guid userID);
	}

	public interface ICategoryRepository
	{
		int CreateNewCategory(Data.Entity.Category theNewCategory);
		int DeleteCategory(int id);
		IList<Entity.Category> GetCategoryByLanguage(int languageID);
		//IList<Entity.Category> GetAllCategoryByLanguage(int languageID);
        int UpdateCategory(Entity.Category theCategory);
		IList<Data.Entity.Category> GetSubCategories(int parentCategoryID);
		Data.Entity.Category GetTheCategory(int categoryID);
	}

	public interface ICountryRepository
	{
		int CreateNewCountry(Data.Entity.Country theNewCountry);
		IList<Entity.Country> GetAllCountry();
	}

	public interface IDocumentRepository
	{
		int CreateNewDocument(Data.Entity.Document theNewDocument);
		int DeleteDocument(int id);
		int DeleteProductDocumentMapping(int documentID);
        IList<Data.Entity.Document> GetDocumentByProduct(int productID);
	}

	public interface ILanguageRepository
	{
		int CreateNewLanguage(Data.Entity.Language theNewLanguage);
		IList<Entity.Language> GetAllLanguage();
        int UpdateLanguage(Entity.Language theLanguage);
		int DeleteLanguage(int id);
	}

	public interface ILocalStringResourceRepository
	{
		int CreateNewLocaleStringResource(Data.Entity.LocalStringResource theNewLocaleStringResource);
		IList<Entity.LocalStringResource> GetLocaleStringResourceByLanguage(int languageID);
		IList<Entity.LocalStringResource> GetAllLocaleStringResource();
        int UpdateLocaleStringResource(Entity.LocalStringResource theLocaleStringResource);
		int DeleteLocaleStringResource(int id);
		Data.Entity.LocalStringResource GetTheLocalStringResource(int id);
	}

	public interface IPictureRepository
	{
		int CreateNewPicture(Data.Entity.Picture theNewPicture);
        IList<Entity.Picture> GetPicturesByProduct(int productID);
        int UpdatePicture(Entity.Picture thePicture);
        Data.Entity.Picture GetPicture(int id);
		IList<Data.Entity.Picture> GetPicturesByProduct_WithoutBinary(int productid);
		Data.Entity.Picture GetTheProductDefaultPicture(int theProductID);
	}

	public interface IProductRepository
	{
		int CreateNewProduct(Data.Entity.Product theNewProduct);
		int DeleteProduct(int id);
		IList<Data.Entity.Product> GetProductsByCategory(int categoryID);
        IList<Entity.Product> GetProductsByTag(int tagID);
		Entity.Product GetProduct(int productID);
        int UpdateProduct(Entity.Product theProduct);
        IList<Data.Entity.Category> GetTheProductCategories(int productID);
        IList<Data.Entity.Product> GetProductByFilter(string metaKeywords, string noMetaKeywords, int categoryID, decimal startPrice, decimal endPrice, int languageID);
		IList<Data.Entity.Product> GetProductsByLanguage(int languageID);
		IList<Data.Entity.Product> GetAllProductsByLanguage(int languageID);
		IList<Data.Entity.ProductTag> GetTheProductTags(int theProductID);
		void SaveProduct_Category_Mapping(Data.Entity.Product_Category_Mapping theProduct_Category_Mapping);
		void SaveProductTag_Product_Mapping(Data.Entity.ProductTag_Product_Mapping theProductTag_Product_Mapping);
		IList<Data.Entity.Product_Category_Mapping> GetProduct_Category_MappingsByProduct(int theProductID);
		bool DeleteProduct_Category_Mapping(Data.Entity.Product_Category_Mapping theProduct_Category_Mapping);
		IList<Data.Entity.ProductTag_Product_Mapping> GetProductTag_Product_MappingByProduct(int theProductID);
		bool DeleteProductTag_Product_Mapping(Data.Entity.ProductTag_Product_Mapping theProductTag_Product_Mapping);
		int IsExistingTheProductAndTagMapping(int productID, int tagID);
		IList<Data.Entity.Product> GetTopSellingProducts();
		IList<Data.Entity.Product> GetProductsByCategory(int categoryID, int pageIndex, int pageSize, out int totalRecords);
		IList<Data.Entity.Product> GetProductsByLanguage(int languageID, int pageIndex, int pageSize, out int totalRecords);
		IList<Entity.Product> GetProductsByTag(int tagID, int pageIndex, int pageSize, out int totalRecords);
	}

	public interface IProductAdditionalPropertyRepository
	{
		int CreateNewProductAdditionalProperty(Data.Entity.ProductAdditionalProperty theNewProductAdditionalProperty);
		IList<Entity.ProductAdditionalProperty> GetProductAdditionalProperties(int productID);
        int UpdateProductAdditionalProperty(Entity.ProductAdditionalProperty theProductAdditionalProperty);
		bool DeleteProductAdditionalProperty(int id);
		void SaveTheCustomerMustKnownContent(Data.Entity.ProductAdditionalProperty theCustomerMustKnownContent);
		Data.Entity.ProductAdditionalProperty GetTheProductAdditionalPropertyByName(string propertyName);
	}

	public interface IProductPictureRepository
	{
		int CreateNewProductPicture(Data.Entity.ProductPicture theNewProductPicture);
		int DeleteProductPicture(Data.Entity.ProductPicture theProductPicture);
		IList<Data.Entity.ProductPicture> GetProductPictureByProduct(int productID);
		int UpdateProductPicture(Data.Entity.ProductPicture theProductPicture);
	}

	public interface IProductRatingRepository
	{
		int CreateNewProductRating(Data.Entity.ProductRating theNewProductRating);
        IList<Entity.ProductRating> GetProductRatingByProduct(int productID);
	}

	public interface IProductReviewRepository
	{
		int CreateNewProductReview(Data.Entity.ProductReview theNewProductReview);
		int DeleteProductReview(int id);
        IList<Entity.ProductReview> GetProductReviewsByProduct(int productID);
        int UpdateProductReview(Entity.ProductReview theProductReview);
		IList<Data.Entity.ProductReview> GetAllProductReviewsByLanguage(int languageID);
	}

	public interface IProductReviewHelpfulnessRepository
	{
		int CreateNewProductReviewHelpfulness(Data.Entity.ProductReviewHelpfulness theNewProductReviewHelpfulness);
	}

	public interface IProductTagRepository
	{
		int CreateNewProductTag(Data.Entity.ProductTag theNewProductTag);
		int DeleteProductTag(int id);
		IList<Entity.ProductTag> GetProductTagByLanguage(int languageID);
		Data.Entity.ProductTag GetTheProductTag(int id);
		int PlusOrMinus1ProductCount(int theProductTagID, int pn1);
	}

	public interface IRelatedProductRepository
	{
		int CreateNewRelatedProduct(Data.Entity.RelatedProduct theNewRelatedProduct);
		int DeleteRelatedProduct(int productID1, int productID2);
		IList<Entity.RelatedProduct> GetRelatedProducts(int productID);
        int UpdateRelatedProduct(Entity.RelatedProduct theRelatedProduct);
		IList<Data.Entity.Product> GetRelatedProducts(System.Collections.Generic.IEnumerable<int> prodIDs);
	}

	public interface ISearchLogRepository
	{
		int CreateNewSearchLog(Data.Entity.SearchLog theNewSearchLog);
	}

	public interface IStateProvinceRepository
	{
		int CreateNewStateProvince(Data.Entity.StateProvince theNewStateProvince);
		IList<Entity.StateProvince> GetStateProvinceByCountry(int countryID);
		IList<Entity.City> GetCityByStateProvince(int stateProvinceID);
		IList<Data.Entity.StateProvince> GetAllStateProvince();
		IList<Data.Entity.City> GetAllCity();
	}

	public interface IUserExtensionRepository
	{
		int CreateNewUserExtension(Data.Entity.UserExtension theNewUserExtension);
        int UpdateUserExtension(Entity.UserExtension theUserExtension);
        Data.Entity.UserExtension GetUserExtensionByUserID(System.Guid userID);
	}

	public interface IUserSessionRepository
	{
		int CreateNewUserSession(Data.Entity.UserSession theNewUserSession);
	}

	public interface IShoppingCartItemRepository
	{
		int CreateNewShoppingCartItem(Entity.ShoppingCartItem theNewShoppingCartItem);
		int DeleteShoppingCartItem(int id);
		IList<Entity.ShoppingCartItem> GetShoppingCartItemByUser(System.Guid userID);
		IList<Entity.ShoppingCartType> GetAllShoppingCartType();
        int UpdateShoppingCartItem(Entity.ShoppingCartItem theShoppingCartItem);
		Data.Entity.ShoppingCartItem GetTheShoppingCartItem(int id);
	}

	public interface IExpressRepository
	{
		IList<Entity.Express> GetAllExpress();
	}

	public interface IOrderRepository
	{
		int CreateNewOrder(Entity.Order theNewOrder);
		int CreateNewOrderNote(Entity.OrderNote theNewOrderNote);
		IList<Entity.OrderNote> GetOrderNoteByOrder(int orderID);
		int DeleteOrder(int id);
		IList<Entity.Order> GetOrderByUser(System.Guid userID);
		IList<Entity.OrderStatus> GetAllOrderStatus();
        int UpdateOrder(Entity.Order theOrder);
		int DeleteTheOrdersProduct(int orderID, int productID);
		IList<Data.Entity.Product> GetTheOrdersProducts(int orderID);
		int CreateNewOrderProductMapping(Data.Entity.Order_Product_Mapping theNewOrder_Product_Mapping);
		Data.Entity.Order GetTheOrderByOrderID(int orderID);
		IList<Data.Entity.Order_Product_Mapping> GetOrderProductMappingByOrder(int theOrderID);
		IList<Data.Entity.Order> GetOrdersByLanguage(int languageID);
		Data.Entity.Order GetTheOrderByOrderNumber(string orderNumber);
		Data.Entity.OrderStatus GetTheOrderStatusByStatusName(string statusName);
	}

	public interface IPaymentMethodRepository
	{
		int CreateNewPaymentMethod(Entity.PaymentMethod theNewPaymentMethod);
		IList<Entity.PaymentMethod> GetAllPaymentMethod();
		IList<Entity.PaymentStatus> GetAllPaymentStatus();
		int DeletePaymentMethod(int id);
		Data.Entity.PaymentMethod GetThePaymentMethod(int id);
		int UpdatePaymentMethod(Data.Entity.PaymentMethod thePaymentMethod);
	}

	public interface IShippingMethodRepository
	{
		int CreateNewShippingMethod(Entity.ShippingMethod theNewShippingMethod);
		IList<Entity.ShippingMethod> GetAllShippingMethod();
		IList<Entity.ShippingStatus> GetAllShippingStatus();
		bool DeleteShippingMethod(int id);
		int UpdateShippingMethod(Data.Entity.ShippingMethod theShippingMethod);
		IList<Data.Entity.ShippingByStateAndProvince> GetShippingByStateAndProvinceByProvince(int stateProvinceID);
		IList<Data.Entity.ShippingMethod> GetShippingMethodByProduct(int productID);
		void SaveProduct_ShippingMethod_Mapping(int productID, int shippingMethodID);
		void DeleteTheProduct_ShippingMethod_Mapping(int productID, int shippingMethodID);
	}

	public interface INewsRepository
	{
		int CreateNews(Data.Entity.News theNewNews);
		IList<Data.Entity.News> GetNewsByLanguage(int languageID);
		IList<Data.Entity.News> GetAllNewsByLanguage(int languageID);
		int DeleteNews(int newsID);
		Data.Entity.News GetTheNews(int id);
		int UpdateNews(Data.Entity.News theNews);
	}

	public interface ICashTicketRepository
	{
		int CreateNewCashTicket(Data.Entity.CashTicket theNewCashTicket);
		IList<Data.Entity.CashTicket> GetMyCashTicket(System.Guid userID);
		int UpdateCashTicket(Data.Entity.CashTicket theCashTicket);
	}
}
